const cloud = require('wx-server-sdk');
cloud.init();

exports.main = async (event, context) => {
  const folder = event.folder || ''; // 传入的文件夹路径
  const MAX_LIMIT = 100;

  // 获取文件列表
  const result = await cloud.getTempFileURL({
    fileList: (await cloud.getTempFileList({ folder })).fileList,
  });

  return result;
};
